﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using ZFSData;
using ZFSData.InterFace.User;
using ZFSData.Manager;

namespace ZFSBusiness
{
    /// <summary>
    /// 菜单管理
    /// </summary>
    public class MenuManager : BaseManager<MenuManager>, IMenu
    {
        /// <summary>
        /// 获取菜单列表(分页)
        /// </summary>
        /// <param name="search"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        public List<tb_Menu> GetPagingModels<S>(int pageIndex, int pageSize, out int totalCount,
            Expression<Func<tb_Menu, bool>> whereLambda, Expression<Func<tb_Menu, S>> orderbyLambda, bool Asc = false)
        {
            return factoryManager.GetMenuManager().GetPagingModels(pageIndex, pageSize, out totalCount, whereLambda, orderbyLambda, Asc);
        }

        /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <returns></returns>
        public List<tb_Menu> GetModels(Expression<Func<tb_Menu, bool>> whereLambda)
        {
            return factoryManager.GetMenuManager().GetModels(whereLambda);
        }

        /// <summary>
        /// 获取菜单树
        /// </summary>
        /// <returns></returns>
        public List<View_MenuTree> GetMenuTrees()
        {
            return factoryManager.GetMenuManager().GetMenuTrees();
        }

        /// <summary>
        /// 新增更新模块信息
        /// </summary>
        /// <param name="tb_Menus"></param>
        /// <returns></returns>
        public bool UpdateMenus(List<tb_Menu> tb_Menus)
        {
            return factoryManager.GetMenuManager().UpdateMenus(tb_Menus);
        }

        public bool DeleteEntity(tb_Menu entity)
        {
            throw new NotImplementedException();
        }

        public bool UpdateEntity(tb_Menu entity)
        {
            throw new NotImplementedException();
        }

        public tb_Menu AddEntity(tb_Menu entity)
        {
            throw new NotImplementedException();
        }

        public bool ExistEntity(Expression<Func<tb_Menu, bool>> whereLambda)
        {
            throw new NotImplementedException();
        }
    }
}
